﻿Imports DAO
Imports DTO
Public Class CChiTietLopBUS
    Public Function ThemChiTietLop(ByVal _CTLdto As CChiTietLopDTO) As Integer
        Dim _dao As New CChiTietLopDAO()
        Dim _kt As Integer = _dao.ThemChiTietLop(_CTLdto)
        Return _kt
    End Function

    Public Function CapNhatChiTietLop(ByVal _HScrt1 As CHocSinhCRT1) As Integer
        Dim _dao As New CChiTietLopDAO()
        Dim _kt As Integer = _dao.CapNhatChiTietLop(_HScrt1)
        Return _kt
    End Function

    Public Function LaySiSoCbb(ByVal _lopdto As CLopDTO) As List(Of CChiTietLopCRT)
        Dim _dao As New CChiTietLopDAO()
        Dim _ds As New List(Of CChiTietLopCRT)
        _ds = _dao.LaySiSocbb(_lopdto)
        Return _ds
    End Function

    Public Function KiemTraSiSo(ByVal _lopdto As CLopDTO) As Integer
        Dim _dao As New CChiTietLopDAO()
        Dim _ds As New List(Of CChiTietLopCRT)
        _ds = _dao.LaySiSocbb(_lopdto)

        If _ds.Count > 0 Then
            If _ds(0).SiSo < _lopdto.SiSoToiDa Then
                Return 1
            End If
        Else
            Return 1
        End If

        Return 0
    End Function

End Class
